package com.nie.mybatisPlus.generator.system;

import cn.hutool.core.net.NetUtil;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * 应用程序主要
 *
 * @author nie_cq
 * @date 2022/11/17
 */
@SpringBootApplication
@MapperScan(basePackages = {"com.nie.mybatisPlus.generator.system.mapper"})
@Slf4j
public class ApplicationMain {
    public static void main(String[] args) {
        ConfigurableApplicationContext ctx = SpringApplication.run(ApplicationMain.class, args);
        Environment env = ctx.getEnvironment();
        log.info("\n--------------------\n\t应用 '{}' 运行成功，访问端口: {}，API文档访问地址：http://{}:{}/doc.html\n--------------------",
                env.getProperty("spring.application.name"), env.getProperty("server.port"), NetUtil.getLocalhostStr(), env.getProperty("server.port"));
    }
}
